package com.enjava.marshaller;

import com.thoughtworks.xstream.XStream;

public class PruebaMarshallerUnmarshaller {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Person joe = new Person("Joe", "Walnes");
		joe.setPhone(new PhoneNumber(123, "1234-456"));
		joe.setFax(new PhoneNumber(123, "9999-999"));
		XStream xstream = new XStream();
		String xml = xstream.toXML(joe);
		System.out.println(xml);

		Person newJoe = (Person)xstream.fromXML(xml);
		System.out.println(newJoe);
	}

}
